/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.giant.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author taticay
 */
@Entity
@Table(name = "in_shipment")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "InShipment.findAll", query = "SELECT i FROM InShipment i"),
    @NamedQuery(name = "InShipment.findByIdShipment", query = "SELECT i FROM InShipment i WHERE i.idShipment = :idShipment"),
    @NamedQuery(name = "InShipment.findByDescription", query = "SELECT i FROM InShipment i WHERE i.description = :description")})
public class InShipment implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_shipment")
    private Integer idShipment;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "description")
    private String description;

    public InShipment() {
    }

    public InShipment(Integer idShipment) {
        this.idShipment = idShipment;
    }

    public InShipment(Integer idShipment, String description) {
        this.idShipment = idShipment;
        this.description = description;
    }

    public Integer getIdShipment() {
        return idShipment;
    }

    public void setIdShipment(Integer idShipment) {
        this.idShipment = idShipment;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idShipment != null ? idShipment.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InShipment)) {
            return false;
        }
        InShipment other = (InShipment) object;
        if ((this.idShipment == null && other.idShipment != null) || (this.idShipment != null && !this.idShipment.equals(other.idShipment))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.giant.entities.InShipment[ idShipment=" + idShipment + " ]";
    }
    
}
